\hypertarget{sc2__client_8h}{}\section{include/sc2api/sc2\+\_\+client.h File Reference}
\label{sc2__client_8h}\index{include/sc2api/sc2\+\_\+client.\+h@{include/sc2api/sc2\+\_\+client.\+h}}


The base class for Agent and Replay\+Observer.  


{\ttfamily \#include $<$string$>$}\newline
{\ttfamily \#include $<$vector$>$}\newline
{\ttfamily \#include $<$cassert$>$}\newline
{\ttfamily \#include \char`\"{}sc2api/sc2\+\_\+typeenums.\+h\char`\"{}}\newline
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classsc2_1_1_client_events}{sc2\+::\+Client\+Events}
\begin{DoxyCompactList}\small\item\em A set of common events a user can override in their derived bot or replay observer class. \end{DoxyCompactList}\item 
class \hyperlink{classsc2_1_1_client}{sc2\+::\+Client}
\begin{DoxyCompactList}\small\item\em The base class for \hyperlink{classsc2_1_1_agent}{Agent} and \hyperlink{classsc2_1_1_replay_observer}{Replay\+Observer}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{sc2__client_8h_ac7d3e3694a208204e099f04c1e5eded0}{sc2\+::\+Client\+Error} \{ \newline
{\bfseries Error\+S\+C2}, 
{\bfseries Invalid\+Ability\+Remap}, 
{\bfseries sc2\+::\+Client\+Error\+::\+Invalid\+Response}, 
{\bfseries sc2\+::\+Client\+Error\+::\+No\+Abilities\+For\+Tag}, 
\newline
{\bfseries sc2\+::\+Client\+Error\+::\+Response\+Not\+Consumed}, 
{\bfseries sc2\+::\+Client\+Error\+::\+Response\+Mismatch}, 
{\bfseries sc2\+::\+Client\+Error\+::\+Connection\+Closed}, 
{\bfseries sc2\+::\+Client\+Error\+::\+S\+C2\+Unknown\+Status}, 
\newline
{\bfseries S\+C2\+App\+Failure}, 
{\bfseries sc2\+::\+Client\+Error\+::\+S\+C2\+Protocol\+Error}, 
{\bfseries sc2\+::\+Client\+Error\+::\+S\+C2\+Protocol\+Timeout}
 \}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{sc2__client_8h_a4e833a715cb3d0fe0efbf46a2847b416}{sc2\+::\+Is\+Carrying\+Minerals} (const Unit \&unit)
\item 
bool \hyperlink{sc2__client_8h_aacc79dc8962c0aee3d14d330e2e74330}{sc2\+::\+Is\+Carrying\+Vespene} (const Unit \&unit)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The base class for Agent and Replay\+Observer. 

The Client and Client\+Events provides most of the functionality a user would be interested in for examining game state and scripting bots. A user should prefer to inherit from either Agent or Replay\+Observer, those classes both inherit from Client. 

\subsection{Enumeration Type Documentation}
\mbox{\Hypertarget{sc2__client_8h_file_ac7d3e3694a208204e099f04c1e5eded0}\label{sc2__client_8h_file_ac7d3e3694a208204e099f04c1e5eded0}} 
\index{sc2\+\_\+client.\+h@{sc2\+\_\+client.\+h}!Client\+Error@{Client\+Error}}
\index{Client\+Error@{Client\+Error}!sc2\+\_\+client.\+h@{sc2\+\_\+client.\+h}}
\subsubsection{\texorpdfstring{Client\+Error}{ClientError}}
{\footnotesize\ttfamily enum \hyperlink{sc2__client_8h_ac7d3e3694a208204e099f04c1e5eded0}{sc2\+::\+Client\+Error}\hspace{0.3cm}{\ttfamily [strong]}}

Errors that the api can encounter, if the On\+Error event in Client\+Events is overwritten it will contain a list of errors encountered. 

\subsection{Function Documentation}
\mbox{\Hypertarget{sc2__client_8h_file_a4e833a715cb3d0fe0efbf46a2847b416}\label{sc2__client_8h_file_a4e833a715cb3d0fe0efbf46a2847b416}} 
\index{sc2\+\_\+client.\+h@{sc2\+\_\+client.\+h}!Is\+Carrying\+Minerals@{Is\+Carrying\+Minerals}}
\index{Is\+Carrying\+Minerals@{Is\+Carrying\+Minerals}!sc2\+\_\+client.\+h@{sc2\+\_\+client.\+h}}
\subsubsection{\texorpdfstring{Is\+Carrying\+Minerals()}{IsCarryingMinerals()}}
{\footnotesize\ttfamily bool sc2\+::\+Is\+Carrying\+Minerals (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} \&}]{unit }\end{DoxyParamCaption})}

Helper function used to discover whether a unit is carrying minerals or not. You could use this function in Get\+Units to get all units carrying minerals\+: Units units = Get\+Units(\+Alliance\+::\+Self, Is\+Carrying\+Minerals); 
\begin{DoxyParams}{Parameters}
{\em unit} & The unit. \\
\hline
{\em observation} & Not needed for this function, only exists for Filter parameters, leave nullptr (its default). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns true if the unit is carrying minerals, false otherwise. 
\end{DoxyReturn}
\mbox{\Hypertarget{sc2__client_8h_file_aacc79dc8962c0aee3d14d330e2e74330}\label{sc2__client_8h_file_aacc79dc8962c0aee3d14d330e2e74330}} 
\index{sc2\+\_\+client.\+h@{sc2\+\_\+client.\+h}!Is\+Carrying\+Vespene@{Is\+Carrying\+Vespene}}
\index{Is\+Carrying\+Vespene@{Is\+Carrying\+Vespene}!sc2\+\_\+client.\+h@{sc2\+\_\+client.\+h}}
\subsubsection{\texorpdfstring{Is\+Carrying\+Vespene()}{IsCarryingVespene()}}
{\footnotesize\ttfamily bool sc2\+::\+Is\+Carrying\+Vespene (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} \&}]{unit }\end{DoxyParamCaption})}

Helper function used to discover whether a unit is carrying vespene or not. You could use this function in Get\+Units to get all units carrying vespene\+: Units units = Get\+Units(\+Alliance\+::\+Self, Is\+Carrying\+Vespene); 
\begin{DoxyParams}{Parameters}
{\em unit} & The unit. \\
\hline
{\em observation} & Not needed for this function, only exists for Filter parameters, leave nullptr (its default). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns true if the unit is carrying vespene, false otherwise. 
\end{DoxyReturn}
